﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace CaoNiMaCoolPad
{
    public partial class Form1 : Form
    {

        public IList<string> Items { get; set; }

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            foreach (var entry in Items)
                entryListBox.Items.Add(entry);
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }




        private void messageEntriesBox_ValueChanged(object sender, EventArgs e)
        {
            decimal length = messageEntriesBox.Value;
            nameOffestBox.Maximum = length - 1;
            phoneNumberOffestBox.Maximum = length - 1;
            dateOffestBox.Maximum = length - 1;
            folderOffestBox.Maximum = length - 1;
            contentOffestBox.Maximum = length - 1;
        }

        private void entryListBox_SelectedIndexChanged(object sender, EventArgs e)
        { selectingLabel.Text = "选中的是索引" + entryListBox.SelectedIndex + "项"; }

        private void addLineAboveButton_Click(object sender, EventArgs e)
        {
            entryListBox.Items.Insert(entryListBox.SelectedIndex, string.Empty);
        }

        private void addLineBelowButton_Click(object sender, EventArgs e)
        {
            entryListBox.Items.Insert(entryListBox.SelectedIndex+1, string.Empty);
        }

        private void deleteLineButton_Click(object sender, EventArgs e)
        {
            entryListBox.Items.RemoveAt(entryListBox.SelectedIndex);
        }



    }
}
